//
//  LeftCellComminuteView.m
//  HZAPP
//
//  Created by huazi on 15/8/8.
//  Copyright (c) 2015年 huazi. All rights reserved.
//

#import "LeftCellComminuteView.h"
#define kColorLeftCellComminute  @"#000000"
@interface LeftCellComminuteView ()
@property (strong, nonatomic)UIView *viewCenterCircle;
@property (strong, nonatomic)UIView *viewUp;
@property (strong, nonatomic)UIView *viewDown;
@end
@implementation LeftCellComminuteView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self =[super initWithFrame:frame]) {
        [self initSubviews];
    }
    return self;
}
- (void)initSubviews {
    self.viewUp =[[UIView alloc] initWithFrame:CGRectMake(2, 0, 2, (self.frame.size.height-6)/2)];
    self.viewUp.backgroundColor =[UIColor colorWithHexString:kColorLeftCellComminute];
    [self addSubview:self.viewUp];
    
    self.viewCenterCircle =[[UIView alloc] initWithFrame:CGRectMake(0, self.frame.size.height/2-3, 6, 6)];
    self.viewCenterCircle.layer.cornerRadius =3.0f;
    self.viewCenterCircle.layer.masksToBounds =YES;
    self.viewCenterCircle.backgroundColor =[UIColor colorWithHexString:kColorLeftCellComminute];
    [self addSubview:self.viewCenterCircle];
    
    self.viewDown =[[UIView alloc] initWithFrame:CGRectMake(2, self.frame.size.height/2+3, 2, (self.frame.size.height-6)/2)];
    self.viewDown.backgroundColor =[UIColor colorWithHexString:kColorLeftCellComminute];
    [self addSubview:self.viewDown];
}
- (void)setType:(CellComminuteViewType)type {
    if (type ==CellComminuteViewTypeOnlyUp) {
        self.viewUp.hidden =NO;
        self.viewCenterCircle.hidden =NO;
        self.viewDown.hidden =YES;
        return;
    }
    if (type ==CellComminuteViewTypeUpDown) {
        self.viewUp.hidden =NO;
        self.viewCenterCircle.hidden =NO;
        self.viewDown.hidden =NO;
        return;
    }
    if (type ==CellComminuteViewTypeOnlyDown) {
        self.viewUp.hidden =YES;
        self.viewCenterCircle.hidden =NO;
        self.viewDown.hidden =NO;
        return;
    }
}
@end
